﻿using System;
using Newtonsoft.Json;

namespace BackTask.Model
{
    public class CronTaskJob : TaskJob
    {
        [JsonProperty("cron")]
        public string Cron { get; set; }

        public CronTaskJob(string cron, string url) : this(cron, url, DateTime.Now.ToString(), 0, string.Empty, Constants.DEFAULT_GROUP_NAME) { }

        public CronTaskJob(string cron, string url, string name) : this(cron, url, name, 0, string.Empty, Constants.DEFAULT_GROUP_NAME) { }

        public CronTaskJob(string cron, string url, string name, int priority) : this(cron, url, name, priority, string.Empty, Constants.DEFAULT_GROUP_NAME) { }
       
        public CronTaskJob(string cron, string url, string name, int priority, string description) : this(cron, url, name, priority, description, Constants.DEFAULT_GROUP_NAME) { }

        public CronTaskJob(string cron, string url, string name, int priority, string description, string groupName)
        {
            this.Name = name;
            this.Cron = cron;
            this.Url = url;
            this.Priority = priority;
            this.Description = description;
            this.GroupName = groupName;
        }

        public CronTaskJob()
        {
        }
    }
}
